<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
 
</head>
<body>
	<t:formvalid formid="formobj" dialog="true" layout="table" enctype="multipart/form-data" 
		action="teachTaskController.do?doAdd" tiptype="3" beforeSubmit="mycheck">
 		<table cellpadding="0" cellspacing="1" class="formtable">
 			<tr>
 				<td>
 					<label class="Validform_label"> 学期: </label>
				</td>
				<td class="value">
					<t:CommonSelect url="semesterInfoController.do?select"
					 value='${semesterName}' name="semester" textField="semesterName" idField="semesterName"></t:CommonSelect>
					<span class="Validform_checktip"></span> 
					<label class="Validform_label"	style="display: none;">学期</label>
				</td>
 			</tr>
 			<tr>
 				<td>
 					<label class="Validform_label"> 开设学院: </label>
				</td>
				<td class="value">
					<t:CommonSelect url="dictCollegeController.do?select"
					 value='${task.college.id }' name="collegeId" textField="text" idField="id"></t:CommonSelect>
					<span class="Validform_checktip"></span> 
					<label class="Validform_label"	style="display: none;">开设学院</label>
				</td>
 			</tr>
 			<tr>
 				<td>
 					<label class="Validform_label"> 专业名称: </label>
				</td>
				<td class="value">
					<t:CommonSelect url="dictMajorController.do?selectObj"
					 value='${task.major.id }' name="majorId" textField="text" idField="id"></t:CommonSelect>
					<span class="Validform_checktip"></span> 
					<label class="Validform_label"	style="display: none;">专业名称</label>
				</td>
 			</tr>
 			<tr>
 				<td>
 					<label class="Validform_label"> 课程名称: </label>
				</td>
				<td class="value">
					<input id="lessonId" name="lessonId" type="hidden"  value='${task.lesson.id }'>               
					<input id="lessonName"  type="text" style="width: 150px" class="inputxt" 
					      readonly="readonly" datatype="*"  >
					<t:choose hiddenName="lessonId" hiddenid="id" url="lessonInfoController.do?goSelect" name="lessonList"
                          icon="icon-search" title="选择" textname="lessonName" isclear="false" isInit="true"  ></t:choose>
					<span class="Validform_checktip"></span> 
					<label class="Validform_label"	style="display: none;"> 课程名称</label>
				</td>
 			</tr>
 			<tr>
				<td align="right">
						<label class="Validform_label">
							班级名称:
						</label>
				</td>
				<td class="value"> 
					     <input id="className"  name="className" type="text" style="width: 150px" class="inputxt" 
					      datatype="*"  >
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">班级</label>						
				</td>					
			</tr>
 		 
 			<tr>
				<td align="right">
						<label class="Validform_label">
							任课教师:
						</label>
				</td>
				<td class="value"> 
                	     <input id="teacherId" name="teacherId" type="hidden"  value='${task.teacher.id }'>               
					     <input id="realName"  type="text" style="width: 150px" class="inputxt" 
					      readonly="readonly" datatype="*"  >
					     <t:choose hiddenName="teacherId" hiddenid="id" url="teacherController.do?goSelect" name="teacherList"
                          icon="icon-search" title="选择" textname="realName" isclear="false" isInit="true"  ></t:choose>
							
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">任课教师</label>
						
				</td>
					
			</tr>
			<tr> 
				<td align="right"><label class="Validform_label">
						总学时: </label>
				</td>
				<td class="value">
					<input id="totalHour" name="totalHour" type="text"
						class="inputxt" datatype="*" maxlength="5"  
						onkeypress="numberValidate()"> 
					<span class="Validform_checktip"></span>
				    <label class="Validform_label" 	style="display: none;">总学时</label>
				</td>
			</tr>
			<tr>
				<td align="right"><label class="Validform_label">
						理论学时: </label>
				</td>
				<td class="value">
					<input id="theoryHour" name="theoryHour" type="text"
						class="inputxt" datatype="*" maxlength="5"  
						onkeypress="numberValidate()"> 
					<span class="Validform_checktip"></span>
				    <label class="Validform_label" 	style="display: none;">理论学时</label>
				</td>
			</tr>
			<tr>
				<td align="right"><label class="Validform_label">
						实验学时: </label>
				</td>
				<td class="value">
					<input id="expHour" name="expHour" type="text"
						class="inputxt" datatype="*" maxlength="5"  
						onkeypress="numberValidate()"> 
					<span class="Validform_checktip"></span>
				    <label class="Validform_label" 	style="display: none;">实验学时</label>
				</td>
			</tr> 
			<tr>
				<td align="right"><label class="Validform_label">
						课程安排: </label>
				</td>
				<td class="value">
					<input id="arrange" name="arrange" type="text" style="width:200px;"
						class="inputxt" datatype="*" maxlength="100"> 
					<span class="Validform_checktip"></span>
				    <label class="Validform_label" 	style="display: none;">课程安排</label>
				</td>
			</tr> 
			<tr>
				<td align="right"><label class="Validform_label">
						人数: </label>
				</td>
				<td class="value">
					<input id="peopleCount" name="peopleCount" type="text" style="width:200px;" onkeypress="numberValidate()"
						class="inputxt"   maxlength="3" value="${task.peopleCount}">   
					<span class="Validform_checktip"></span>
				    <label class="Validform_label" 	style="display: none;">人数</label>
				</td>
			</tr>
		</table>
 
	</t:formvalid>
</body>
<script>
	function mycheck(){
		var total = parseInt($('#totalHour').val());
		var theoryHour = parseInt($('#theoryHour').val());
		var expHour = parseInt($('#expHour').val());
		
		if(expHour+theoryHour != total){
			tip("实验学时与理论学时之和不等于总学时！");
			return false;
		}
		return true;
	}
</script>
    
 